<%@page import="com.sun.java.swing.plaf.windows.resources.windows"%>
<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ page import="xupt.se.ttms.model.Employee" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
            + path + "/";
%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="../css/bootstrap.min.css" rel="stylesheet">
<title>个人信息页</title>
<style>
.table th, .table td {
	text-align: center;
	height: 30px;
}
</style>
</head>
<body>

  <jsp:include page="../top.jsp"></jsp:include>
  

<%-- <%@ include file="../top.jsp" %> --%>
	<div class="row" style="padding: 10px 10px">

		<!-- 左导航栏 -->
		<%@ include file="../nav.jsp"%>
        <%
                 String tag= (String)request.getAttribute("tag");
                 if("ok".equals(tag)){
         %>
                <script type="text/javascript">
                alert("修改成功！！！")
                </script>
         <% 
                 }
        %>
		<!-- 个人信息页 -->
		<div class="col-md-10" style="padding-top:10px">
			<form class="form-horizontal" role="form" action="../user/UserServlet?method=update" method="post">
            <input type="hidden" name="emp_id" value="${employee.emp_id }">
			<input type="hidden" name="emp_no" value="${employee.emp_no }">
				
				
				<div class="form-group">
					<label for="emp_name" class="col-sm-2 control-label">用户姓名</label>
					<div class="col-sm-6">
						<input type="text" class="form-control" id="emp_name" name="emp_name" pattern="[\u4e00-\u9fa5]{2,10}"
							required="required" oninvalid="setCustomValidity('请输入真实姓名,10字以内!')"
							oninput="setCustomValidity('')"  value="${employee.emp_name}">
					</div>
				</div>
				<div class="form-group">
                    <label for="emp_pass" class="col-sm-2 control-label">用户密码</label>
                    <div class="col-sm-6">
                        <input type="text" class="form-control" id="emp_name" name="emp_pass" pattern="[0-9a-zA-Z]{2,10}"
                            required="required" oninvalid="setCustomValidity('请输入密码,2-10字母数字以内!')"
                            oninput="setCustomValidity('')"  value="<%= (String)request.getSession().getAttribute("emp_pass")%>">
                    </div>
                </div>
				<div class="form-group">
					<label for="emp_tel_num" class="col-sm-2 control-label">电话号码</label>
					<div class="col-sm-6">
						<input type="tel" class="form-control" id="emp_tel_num" name="emp_tel_num" pattern="1[3-8][0-9]{9}" 
							required="required" oninvalid="setCustomValidity('请输入正确手机号码!')"
							oninput="setCustomValidity('')" value="${employee.emp_tel_num}">
					</div>
				</div>
				<div class="form-group">
					<label for="emp_addr" class="col-sm-2 control-label">地址</label>
					<div class="col-sm-6">
						<input type="text" class="form-control" id="emp_addr" name="emp_addr" pattern=".{2,30}" 
							required="required" oninvalid="setCustomValidity('请输入地址!')"
							oninput="setCustomValidity('')" value="${employee.emp_addr}">
					</div>
				</div>
				<div class="form-group">
					<label for="emp_email" class="col-sm-2 control-label">邮箱</label>
					<div class="col-sm-6">
						<input type="email" class="form-control" id="emp_email" name="emp_email"
							required="required"  oninvalid="setCustomValidity('请输入正确格式Email!')"
							pattern="([a-zA-Z0-9_-])+@[a-zA-Z0-9_-]+((\.[a-zA-Z0-9_-]{2,3}){1,2})"
							oninput="setCustomValidity('')" value="${employee.emp_email}">
					</div>
				</div>
		
				<div class="form-group">
					<div class="col-sm-2 control-label" style="color:red;font-weight: bold;">${result}</div>
					<div class="col-sm-6">
						<!-- <input type="hidden" name="method" value="update"> -->
						<button type="submit" class="btn btn-primary">保    存</button>						
					</div>
				</div>
			</form>
			
                <div class="form-group">
                    <label for="emp_name" class="col-sm-2 control-label">用户头像</label>
                    <div class="col-sm-6">
                        <form type="file" method="post" enctype="multipart/form-data" action="../user/UpdateHead">
                            <img src="<%=basePath %>${user.path}" width=100 height=100 /><br>
                            <input type="file"  name="head_path" class="file"/>
                            <input type="submit" class="btn btn-primary" value="修改">
                        </form>
                    </div>
                </div>
		</div>
	</div>
</body>
</html>